﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using Assist;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.DB;
using YArchitech.Revit;
using YArchitech.Revit.RevitExtension;
using YJKStairs.CommonUnit;
using YJKStairs.DataInfos;

namespace YJKStairs.Kit
{
	public class ProjectionDrawingKit
	{
		public ProjectionDrawingKit(Autodesk.Revit.ApplicationServices.Application app)
		{
			this.m_App = app;
		}

		protected void CalulateTransform(bool lrMirror, bool tbMirror, double rotateAngle, double bundingBoxWidth, double bundingBoxHeight, XYZ ptOrigin)
		{
			Transform transform = Transform.Identity;
			if (!Geometry.IsEqual(rotateAngle, 0.0))
			{
				transform = RevitVersionFuncs.CreateRotationAtPoint(XYZ.BasisZ, rotateAngle, ptOrigin);
			}
			Plane plane = RevitVersionFuncs.CreatePlanByNormalAndOrigin(XYZ.BasisX, new XYZ(bundingBoxWidth / 2.0, 0.0, 0.0));
			Transform transform2 = Transform.Identity;
			if (lrMirror)
			{
				transform2 = RevitVersionFuncs.CreateReflection(plane);
			}
			Plane plane2 = RevitVersionFuncs.CreatePlanByNormalAndOrigin(XYZ.BasisY, new XYZ(0.0, bundingBoxHeight / 2.0, 0.0));
			Transform transform3 = Transform.Identity;
			if (tbMirror)
			{
				transform3 = RevitVersionFuncs.CreateReflection(plane2);
			}
			this.m_Transform = transform.Multiply(transform2);
			this.m_Transform = this.m_Transform.Multiply(transform3);
		}

		protected List<CurveInfo> DrawBasePoint(XYZ ptBase, double lengthBase = 100.0)
		{
			int num = 2;
			List<CurveInfo> list = new List<CurveInfo>();
			double num2 = Common.MMToFeet(lengthBase);
			XYZ ptS = new XYZ(ptBase.X - num2, ptBase.Y + num2, 0.0);
			XYZ ptE = new XYZ(ptBase.X + num2, ptBase.Y - num2, 0.0);
			list.Add(this.NewLine(PenColor.PC_Red, DashStyle.Solid, (float)num, ptS, ptE, null));
			ptS = new XYZ(ptBase.X - num2, ptBase.Y - num2, 0.0);
			ptE = new XYZ(ptBase.X + num2, ptBase.Y + num2, 0.0);
			list.Add(this.NewLine(PenColor.PC_Red, DashStyle.Solid, (float)num, ptS, ptE, null));
			return list;
		}

		private List<CurveInfo> DrawArrows(EdgeInfo centerCurve, double leftWidth, double rightWidth)
		{
			List<CurveInfo> list = new List<CurveInfo>();
			XYZ startPoint = centerCurve.StartPoint;
			XYZ endPoint = centerCurve.EndPoint;
			float lineWidth = 2f;
			if (centerCurve.IsArc)
			{
				XYZ xyz = null;
				Geometry.GetCenterWithBulge(startPoint, endPoint, centerCurve.Bulge, ref xyz);
				XYZ xyz2 = XYZ.BasisZ;
				if (Geometry.LessThan(centerCurve.Bulge, 0.0))
				{
					xyz2 = -XYZ.BasisZ;
				}
				XYZ ptM = Geometry.CalculatMidPoint(startPoint, endPoint, xyz, xyz2);
				double num = 0.0;
				Geometry.GetRadiusWithBulge(startPoint, endPoint, centerCurve.Bulge, ref num);
				XYZ pt = (endPoint - xyz).Normalize();
				double num2 = Math.Min(leftWidth, rightWidth);
				XYZ xyz3 = Geometry.RotateTo(pt, -1.0471975511965976, xyz2).Normalize() * num2;
				XYZ xyz4 = Geometry.RotateTo(pt, -2.0943951023931953, xyz2).Normalize() * num2;
				list.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint, endPoint, ptM));
				XYZ ptE = endPoint + xyz4;
				list.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint, ptE, null));
				XYZ ptE2 = endPoint + xyz3;
				list.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint, ptE2, null));
			}
			else
			{
				XYZ xyz5 = (endPoint - startPoint).Normalize();
				double num3 = Math.Min(leftWidth, rightWidth);
				XYZ xyz6 = Geometry.RotateTo(-xyz5, 0.52359877559829882, XYZ.BasisZ).Normalize() * num3;
				XYZ xyz7 = Geometry.RotateTo(-xyz5, -0.52359877559829882, XYZ.BasisZ).Normalize() * num3;
				list.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint, endPoint, null));
				list.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint, endPoint + xyz7, null));
				list.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint, endPoint + xyz6, null));
			}
			return list;
		}

		protected CurveInfo NewArc(PenColor color, DashStyle dashStyle, float m_LineWidth1, XYZ ptS, XYZ ptE, XYZ ptM)
		{
			XYZ startPnt = Geometry.TransformPoint(ptS, this.m_Transform);
			XYZ endPnt = Geometry.TransformPoint(ptE, this.m_Transform);
			XYZ radianPnt = Geometry.TransformPoint(ptM, this.m_Transform);
			Arc curve = null;
			CurveInfo result;
			try
			{
				curve = this.m_App.CreatYJKArc(startPnt, endPnt, radianPnt);
				result = new CurveInfo(curve, color, dashStyle, m_LineWidth1);
			}
			catch (Exception)
			{
				result = new CurveInfo(curve, color, dashStyle, m_LineWidth1);
			}
			return result;
		}

		protected CurveInfo NewLine(PenColor color, DashStyle dashStyle, float m_LineWidth1, XYZ ptS, XYZ ptE, XYZ normal = null)
		{
			XYZ startPoint = Geometry.TransformPoint(ptS, this.m_Transform);
			XYZ endPoint = Geometry.TransformPoint(ptE, this.m_Transform);
			Line curve = null;
			CurveInfo result;
			try
			{
				curve = YJKLineEx.YJKGetBound(startPoint, endPoint);
				CurveInfo curveInfo = new CurveInfo(curve, color, dashStyle, m_LineWidth1);
				if (normal != null)
				{
					XYZ xyz = XYZ.Zero;
					XYZ point = normal.Normalize();
					xyz = Geometry.TransformPoint(xyz, this.m_Transform);
					normal = (Geometry.TransformPoint(point, this.m_Transform) - xyz).Normalize();
					curveInfo.Normal = normal;
				}
				result = curveInfo;
			}
			catch (Exception)
			{
				CurveInfo curveInfo2 = new CurveInfo(curve, color, dashStyle, m_LineWidth1);
				if (normal != null)
				{
					XYZ xyz2 = XYZ.Zero;
					XYZ point2 = normal.Normalize();
					xyz2 = Geometry.TransformPoint(xyz2, this.m_Transform);
					normal = (Geometry.TransformPoint(point2, this.m_Transform) - xyz2).Normalize();
					curveInfo2.Normal = normal;
				}
				result = curveInfo2;
			}
			return result;
		}

		protected void DrawLinearRun(LineRunData runInfo, XYZ ptBaseLB, XYZ ptBaseRB, XYZ ptBaseRT, XYZ ptBaseLT, ref SingleRunCurveInfo RunCurveInfo, ref List<CurveInfo> otherCurvesInfoList, bool bDrawNoteInfo)
		{
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, ptBaseLT, null));
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseRB, ptBaseRT, null));
			XYZ xyz = Geometry.CalculatMidPoint(ptBaseLB, ptBaseRB);
			XYZ xyz2 = Geometry.CalculatMidPoint(ptBaseLT, ptBaseRT);
			XYZ xyz3 = (xyz2 - xyz).Normalize() * runInfo.TreadDepth;
			for (int i = 0; i < runInfo.TreadCount + 1; i++)
			{
				XYZ ptS = ptBaseLB + xyz3 * (double)i;
				XYZ ptE = ptBaseRB + xyz3 * (double)i;
				PenColor color = PenColor.PC_Gray;
				DashStyle dashStyle = DashStyle.Dash;
				float num = 1f;
				if (i == 0 || i == runInfo.TreadCount)
				{
					color = PenColor.PC_Black;
					dashStyle = DashStyle.Solid;
					num *= 2f;
				}
				if (i == runInfo.TreadCount)
				{
					ptS = ptBaseLT;
					ptE = ptBaseRT;
				}
				RunCurveInfo.RunRiserCurvesInfoList.Add(this.NewLine(color, dashStyle, num, ptS, ptE, null));
			}
			RunCurveInfo.RunPathCurvesInfoList.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz, xyz2, null));
			EdgeInfo centerCurve = new EdgeInfo(xyz, xyz2, 0.0);
			double num2 = runInfo.RunWidth * 0.4;
			if (bDrawNoteInfo)
			{
				otherCurvesInfoList.AddRange(this.DrawArrows(centerCurve, num2, num2));
			}
		}

		protected void DrawArcRun(ArcRunData runData, ref SingleRunCurveInfo RunCurveInfo, ref List<CurveInfo> otherCurvesInfoList, bool bDrawNoteInfo)
		{
			double num = runData.RunIncludeAngle;
			if (runData.Clockwise)
			{
				num = -num;
			}
			XYZ ptRunBottomLeft = runData.PtRunBottomLeft;
			XYZ ptRunTopLeft = runData.PtRunTopLeft;
			XYZ ptRunTopRight = runData.PtRunTopRight;
			XYZ ptRunBottomRight = runData.PtRunBottomRight;
			XYZ ptRunMiddleLeft = runData.ptRunMiddleLeft;
			XYZ ptRunMiddleRight = runData.ptRunMiddleRight;
			double num2 = runData.RunRadius - runData.RunWidth;
			double runRadius = runData.RunRadius;
			double angle = runData.RunStartAngle + num;
			double angle2 = runData.RunStartAngle + num / 2.0;
			XYZ runCenter = runData.RunCenter;
			XYZ xyz = Geometry.RotateTo(XYZ.BasisX, runData.RunStartAngle, XYZ.BasisZ);
			XYZ xyz2 = Geometry.RotateTo(XYZ.BasisX, angle, XYZ.BasisZ);
			Geometry.RotateTo(XYZ.BasisX, angle2, XYZ.BasisZ);
			double num3 = runData.RunWidth * 0.4;
			if (Geometry.LessThan(Math.Abs(num), Math.PI*2))
			{
				RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, ptRunBottomLeft, ptRunTopLeft, ptRunMiddleLeft));
				RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, ptRunBottomRight, ptRunTopRight, ptRunMiddleRight));
				double num4 = num / (double)runData.TreadCount;
				for (int i = 0; i < runData.TreadCount + 1; i++)
				{
					XYZ xyz3 = Geometry.RotateTo(XYZ.BasisX, runData.RunStartAngle + (double)i * num4, XYZ.BasisZ);
					XYZ ptS = runCenter + xyz3 * num2;
					XYZ ptE = runCenter + xyz3 * runRadius;
					PenColor color = PenColor.PC_Gray;
					DashStyle dashStyle = DashStyle.Dash;
					float num5 = 1f;
					if (i == 0 || i == runData.TreadCount)
					{
						color = PenColor.PC_Black;
						dashStyle = DashStyle.Solid;
						num5 *= 2f;
					}
					RunCurveInfo.RunRiserCurvesInfoList.Add(this.NewLine(color, dashStyle, num5, ptS, ptE, null));
				}
				XYZ xyz4 = runCenter + xyz * (runData.RunRadius - runData.RunWidth / 2.0);
				XYZ xyz5 = runCenter + xyz2 * (runData.RunRadius - runData.RunWidth / 2.0);
				double bulge = Geometry.GetBulge(xyz4, xyz5, runCenter, !runData.Clockwise);
				EdgeInfo centerCurve = new EdgeInfo(xyz4, xyz5, bulge);
				otherCurvesInfoList.AddRange(this.DrawArrows(centerCurve, num3, num3));
				return;
			}
			XYZ xyz6 = runCenter + XYZ.BasisX * num2;
			XYZ xyz7 = runCenter + XYZ.BasisX * runRadius;
			XYZ xyz8 = runCenter - XYZ.BasisX * num2;
			XYZ xyz9 = runCenter - XYZ.BasisX * runRadius;
			XYZ ptM = runCenter + XYZ.BasisY * num2;
			XYZ ptM2 = runCenter + XYZ.BasisY * runRadius;
			XYZ ptM3 = runCenter - XYZ.BasisY * num2;
			XYZ ptM4 = runCenter - XYZ.BasisY * runRadius;
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, xyz6, xyz8, ptM));
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, xyz7, xyz9, ptM2));
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, xyz8, xyz6, ptM3));
			RunCurveInfo.RunBoundaryCurvesInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, 2f, xyz9, xyz7, ptM4));
			XYZ xyz10 = runCenter + XYZ.BasisX * runData.RunRadius;
			XYZ xyz11 = runCenter - XYZ.BasisX * runData.RunRadius;
			XYZ ptM5 = runCenter + XYZ.BasisY * runData.RunRadius;
			XYZ ptM6 = runCenter - XYZ.BasisY * runData.RunRadius;
			RunCurveInfo.RunPathCurvesInfoList.Add(this.NewArc(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz10, xyz11, ptM5));
			RunCurveInfo.RunPathCurvesInfoList.Add(this.NewArc(PenColor.PC_Gray, DashStyle.Solid, 1f, xyz11, xyz10, ptM6));
			double num6 = num / (double)runData.TreadCount;
			RunCurveInfo.RunRiserCurvesInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptRunBottomLeft, ptRunBottomRight, null));
			for (int j = 1; j < runData.TreadCount; j++)
			{
				double num7 = (double)j * num6;
				if (Geometry.Greaterthan_Or_Equal(num7, Math.PI*2))
				{
					break;
				}
				XYZ xyz12 = Geometry.RotateTo(XYZ.BasisX, runData.RunStartAngle + num7, XYZ.BasisZ);
				XYZ ptS2 = runCenter + xyz12 * num2;
				XYZ ptE2 = runCenter + xyz12 * runRadius;
				RunCurveInfo.RunRiserCurvesInfoList.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Dash, 1f, ptS2, ptE2, null));
			}
			RunCurveInfo.RunRiserCurvesInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptRunTopLeft, ptRunTopRight, null));
			XYZ xyz13 = Geometry.RotateTo(XYZ.BasisX, runData.RunStartAngle + Math.PI, XYZ.BasisZ);
			XYZ xyz14 = runCenter + xyz * (runData.RunRadius - runData.RunWidth / 2.0);
			XYZ xyz15 = runCenter + xyz13 * (runData.RunRadius - runData.RunWidth / 2.0);
			double bulge2 = Geometry.GetBulge(xyz14, xyz15, runCenter, !runData.Clockwise);
			EdgeInfo centerCurve2 = new EdgeInfo(xyz14, xyz15, bulge2);
			otherCurvesInfoList.AddRange(this.DrawArrows(centerCurve2, num3, num3));
		}

		protected List<CurveInfo> CreateLandEdgeloop(List<XYZ> arPoints)
		{
			List<CurveInfo> list = new List<CurveInfo>();
			if (arPoints.Count > 2)
			{
				for (int i = 0; i < arPoints.Count - 1; i++)
				{
					CurveInfo item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[i], arPoints[i + 1], null);
					if (item.CurveObj != null)
					{
						list.Add(item);
					}
				}
				int index = arPoints.Count - 1;
				CurveInfo item2 = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[index], arPoints[0], null);
				if (item2.CurveObj != null)
				{
					list.Add(item2);
				}
			}
			return list;
		}

		protected List<CurveInfo> CreateLoopCurves(List<XYZ> arPoints)
		{
			List<CurveInfo> list = new List<CurveInfo>();
			if (arPoints.Count > 2)
			{
				for (int i = 0; i < arPoints.Count - 1; i++)
				{
					CurveInfo item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 0.5f, arPoints[i], arPoints[i + 1], null);
					if (item.CurveObj != null)
					{
						list.Add(item);
					}
				}
				int index = arPoints.Count - 1;
				CurveInfo item2 = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 0.5f, arPoints[index], arPoints[0], null);
				if (item2.CurveObj != null)
				{
					list.Add(item2);
				}
			}
			return list;
		}

		private void DrawDoubleBranchParallelLanding(ref List<CurveInfo> landingEdgeLoop, BaseLandingData landingData, XYZ ptBaseLB, XYZ ptBaseRB, XYZ ptBaseLM, XYZ ptBaseRM, XYZ ptBaseRT, XYZ ptBaseLT, LineRunData runLeft, LineRunData runRight, LineRunData runMid, double dWellWidth, int nTreadAlign)
		{
			if (runMid.TreadCount != runLeft.TreadCount && LandingType.LT_None != landingData.TheType && (1E-09 < landingData.Width || (LandingType.LT_Sector == landingData.TheType && 1E-09 >= landingData.Width)))
			{
				if (runMid.TreadCount > runLeft.TreadCount)
				{
					if (nTreadAlign == 0)
					{
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, ptBaseRB, null));
					}
					else
					{
						XYZ xyz = new XYZ(runLeft.RunWidth + dWellWidth, 0.0, 0.0);
						XYZ xyz2 = new XYZ(runLeft.RunWidth + runMid.RunWidth + dWellWidth, 0.0, 0.0);
						XYZ xyz3 = ptBaseLB + xyz;
						XYZ xyz4 = ptBaseLB + xyz2;
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, xyz3, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz3, ptBaseLM, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLM, ptBaseRM, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseRM, xyz4, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz4, ptBaseRB, null));
					}
				}
				else
				{
					double num = -Math.Abs(runLeft.RunLength - runMid.RunLength);
					if (1 == nTreadAlign)
					{
						XYZ xyz5 = new XYZ(0.0, num / 2.0, 0.0);
						XYZ xyz6 = new XYZ(runLeft.RunWidth, 0.0, 0.0);
						new XYZ(runRight.RunWidth, 0.0, 0.0);
						XYZ xyz7 = new XYZ(runMid.RunWidth + 2.0 * dWellWidth, 0.0, 0.0);
						XYZ xyz8 = ptBaseLB + xyz6;
						XYZ xyz9 = xyz8 + xyz5;
						XYZ xyz10 = xyz9 + xyz7;
						XYZ xyz11 = xyz8 + xyz7;
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, xyz8, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz8, xyz9, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz9, xyz10, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz10, xyz11, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz11, ptBaseRB, null));
					}
					else if (2 == nTreadAlign)
					{
						XYZ xyz12 = new XYZ(0.0, num, 0.0);
						XYZ xyz13 = new XYZ(runLeft.RunWidth, 0.0, 0.0);
						new XYZ(runRight.RunWidth, 0.0, 0.0);
						XYZ xyz14 = new XYZ(runMid.RunWidth + 2.0 * dWellWidth, 0.0, 0.0);
						XYZ xyz15 = ptBaseLB + xyz13;
						XYZ xyz16 = xyz15 + xyz12;
						XYZ xyz17 = xyz16 + xyz14;
						XYZ xyz18 = xyz15 + xyz14;
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, xyz15, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz15, xyz16, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz16, xyz17, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz17, xyz18, null));
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, xyz18, ptBaseRB, null));
					}
					else
					{
						landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, ptBaseRB, null));
					}
				}
			}
			else if (runMid.TreadCount == runLeft.TreadCount && landingData.TheType != LandingType.LT_None && (1E-09 < landingData.Width || (LandingType.LT_Sector == landingData.TheType && 1E-09 >= landingData.Width)))
			{
				landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLB, ptBaseRB, null));
			}
			if (landingData.TheType == LandingType.LT_Rect && 1E-09 < landingData.Width)
			{
				landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseRB, ptBaseRT, null));
				landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseRT, ptBaseLT, null));
				landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLT, ptBaseLB, null));
				return;
			}
			if (LandingType.LT_Sector == landingData.TheType)
			{
				if (1E-09 < landingData.Width || (runMid.TreadCount > runLeft.TreadCount && nTreadAlign != 0))
				{
					landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseRB, ptBaseRT, null));
				}
				double num2 = runLeft.RunWidth + runMid.RunWidth + runRight.RunWidth + 2.0 * dWellWidth;
				XYZ xyz19 = Geometry.CalculatMidPoint(ptBaseLT, ptBaseRT);
				XYZ xyz20 = new XYZ(0.0, num2 / 2.0, 0.0);
				XYZ ptM = xyz19 + xyz20;
				landingEdgeLoop.Add(this.NewArc(PenColor.PC_Gray, DashStyle.Solid, 2f, ptBaseRT, ptBaseLT, ptM));
				if (1E-09 < landingData.Width || (runMid.TreadCount > runLeft.TreadCount && nTreadAlign != 0))
				{
					landingEdgeLoop.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, ptBaseLT, ptBaseLB, null));
				}
			}
		}

		private List<CurveInfo> CreateTrigonlandOneCurve(List<XYZ> arPoints)
		{
			List<CurveInfo> list = new List<CurveInfo>();
			if (6 == arPoints.Count)
			{
				CurveInfo item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[0], arPoints[1], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
				item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[1], arPoints[2], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
				item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[2], arPoints[3], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
				item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[3], arPoints[4], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
				item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[4], arPoints[5], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
				item = this.NewLine(PenColor.PC_Black, DashStyle.Solid, 2f, arPoints[5], arPoints[0], null);
				if (item.CurveObj != null)
				{
					list.Add(item);
				}
			}
			return list;
		}

		private void DrawTrigonStairsLandCurves(ref TrigonStairs param_stairs, bool bClockwiseUp, XYZ ptBL, XYZ ptBR, XYZ ptML, XYZ ptMR, XYZ ptTL, XYZ ptTR)
		{
			if (param_stairs != null && param_stairs.m_LandData.TheType == LandingType.LT_Trigon)
			{
				LineRunData bottomRunData = param_stairs.m_BottomRunData;
				LineRunData midRunData = param_stairs.m_MidRunData;
				LineRunData topRunData = param_stairs.m_TopRunData;
				List<XYZ> list = new List<XYZ>();
				list.Add(XYZ.Zero);
				list.Add(XYZ.Zero);
				list.Add(XYZ.Zero);
				list.Add(XYZ.Zero);
				list.Add(XYZ.Zero);
				list.Add(XYZ.Zero);
				list[0] = bottomRunData.PtRunTopLeft;
				list[1] = ptBL;
				list[2] = ptBR;
				list[3] = midRunData.PtRunBottomLeft;
				list[4] = midRunData.PtRunBottomRight;
				list[5] = bottomRunData.PtRunTopRight;
				double num;
				if (bClockwiseUp)
				{
					num = midRunData.BottomElevation;
				}
				else
				{
					num = bottomRunData.BottomElevation;
				}
				LandingCurveInfo item = new LandingCurveInfo(this.CreateTrigonlandOneCurve(list), num);
				param_stairs.m_listLandCurve.Add(item);
				list[0] = midRunData.PtRunTopLeft;
				list[1] = ptML;
				list[2] = ptMR;
				list[3] = topRunData.PtRunBottomLeft;
				list[4] = topRunData.PtRunBottomRight;
				list[5] = midRunData.PtRunTopRight;
				if (bClockwiseUp)
				{
					num = topRunData.BottomElevation;
				}
				else
				{
					num = midRunData.BottomElevation;
				}
				LandingCurveInfo item2 = new LandingCurveInfo(this.CreateTrigonlandOneCurve(list), num);
				param_stairs.m_listLandCurve.Add(item2);
				list[0] = topRunData.PtRunTopLeft;
				list[1] = ptTL;
				list[2] = ptTR;
				list[3] = bottomRunData.PtRunBottomLeft;
				list[4] = bottomRunData.PtRunBottomRight;
				list[5] = topRunData.PtRunTopRight;
				if (bClockwiseUp)
				{
					num = topRunData.BottomElevation + topRunData.RunHeight + 2.0 * topRunData.TreadHeight;
				}
				else
				{
					num = bottomRunData.BottomElevation + bottomRunData.RunHeight + 2.0 * bottomRunData.TreadHeight;
				}
				double num2 = bottomRunData.TreadHeight;
				if (num2 < 0.49)
				{
					num2 = 0.49;
				}
				LandingCurveInfo item3 = new LandingCurveInfo(this.CreateTrigonlandOneCurve(list), num - num2);
				param_stairs.m_dTopLandOffset = num2;
				param_stairs.m_listLandCurve.Add(item3);
				if (!bClockwiseUp)
				{
					LandingCurveInfo value = param_stairs.m_listLandCurve[0];
					param_stairs.m_listLandCurve[0] = param_stairs.m_listLandCurve[1];
					param_stairs.m_listLandCurve[1] = value;
				}
			}
		}

		private void DrawTrigonStairRunCurve(ref TrigonStairs param_stairs, bool bClockwiseUp, bool bDrawNoteInfo)
		{
			if (param_stairs != null)
			{
				LineRunData bottomRunData = param_stairs.m_BottomRunData;
				LineRunData midRunData = param_stairs.m_MidRunData;
				LineRunData topRunData = param_stairs.m_TopRunData;
				if (!bClockwiseUp)
				{
					SingleRunCurveInfo singleRunCurveInfo = new SingleRunCurveInfo();
					singleRunCurveInfo.BottomElevation = topRunData.BottomElevation;
					this.DrawLinearRun(topRunData, topRunData.PtRunTopRight, topRunData.PtRunTopLeft, topRunData.PtRunBottomLeft, topRunData.PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
					param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
					singleRunCurveInfo = new SingleRunCurveInfo();
					singleRunCurveInfo.BottomElevation = midRunData.BottomElevation;
					this.DrawLinearRun(midRunData, midRunData.PtRunTopRight, midRunData.PtRunTopLeft, midRunData.PtRunBottomLeft, midRunData.PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
					param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
					singleRunCurveInfo = new SingleRunCurveInfo();
					singleRunCurveInfo.BottomElevation = bottomRunData.BottomElevation;
					this.DrawLinearRun(bottomRunData, bottomRunData.PtRunTopRight, bottomRunData.PtRunTopLeft, bottomRunData.PtRunBottomLeft, bottomRunData.PtRunBottomRight, ref singleRunCurveInfo, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
					param_stairs.m_listRunCurve.Add(singleRunCurveInfo);
					return;
				}
				SingleRunCurveInfo singleRunCurveInfo2 = new SingleRunCurveInfo();
				singleRunCurveInfo2.BottomElevation = bottomRunData.BottomElevation;
				this.DrawLinearRun(bottomRunData, bottomRunData.PtRunBottomLeft, bottomRunData.PtRunBottomRight, bottomRunData.PtRunTopRight, bottomRunData.PtRunTopLeft, ref singleRunCurveInfo2, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo2);
				singleRunCurveInfo2 = new SingleRunCurveInfo();
				singleRunCurveInfo2.BottomElevation = midRunData.BottomElevation;
				this.DrawLinearRun(midRunData, midRunData.PtRunBottomLeft, midRunData.PtRunBottomRight, midRunData.PtRunTopRight, midRunData.PtRunTopLeft, ref singleRunCurveInfo2, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo2);
				singleRunCurveInfo2 = new SingleRunCurveInfo();
				singleRunCurveInfo2.BottomElevation = topRunData.BottomElevation;
				this.DrawLinearRun(topRunData, topRunData.PtRunBottomLeft, topRunData.PtRunBottomRight, topRunData.PtRunTopRight, topRunData.PtRunTopLeft, ref singleRunCurveInfo2, ref param_stairs.m_listOtherCurve, bDrawNoteInfo);
				param_stairs.m_listRunCurve.Add(singleRunCurveInfo2);
			}
		}

		private void DrawTrigionStairBeamCurve(ref TrigonStairs param_stairs, bool bClockwiseUp, XYZ ptBottomLandL, XYZ ptBottomLandR, XYZ ptMidLandL, XYZ ptMidLandR, XYZ ptToplandL, XYZ ptTopLandR, bool bBottom, bool bMid, bool bLand, bool bTop)
		{
			LineRunData bottomRunData = param_stairs.m_BottomRunData;
			LineRunData midRunData = param_stairs.m_MidRunData;
			LineRunData topRunData = param_stairs.m_TopRunData;
			double num = param_stairs.m_BeamData.BeamWidth / 2.0;
			double angle = Math.PI*.5;
			XYZ xyz = ptBottomLandL - ptBottomLandR;
			xyz = Geometry.RotateTo(xyz, angle, XYZ.BasisZ);
			xyz = xyz.Normalize();
			xyz = xyz.Multiply(num);
			XYZ xyz2 = ptMidLandL - ptMidLandR;
			xyz2 = Geometry.RotateTo(xyz2, angle, XYZ.BasisZ);
			xyz2 = xyz2.Normalize();
			xyz2 = xyz2.Multiply(num);
			XYZ xyz3 = ptToplandL - ptTopLandR;
			xyz3 = Geometry.RotateTo(xyz3, angle, XYZ.BasisZ);
			xyz3 = xyz3.Normalize();
			xyz3 = xyz3.Multiply(num);
			XYZ xyz4 = bottomRunData.PtRunTopLeft - bottomRunData.PtRunBottomLeft;
			xyz4 = xyz4.Normalize();
			xyz4 = xyz4.Multiply(num);
			XYZ xyz5 = midRunData.PtRunTopLeft - midRunData.PtRunBottomLeft;
			xyz5 = xyz5.Normalize();
			xyz5 = xyz5.Multiply(num);
			XYZ xyz6 = topRunData.PtRunTopLeft - topRunData.PtRunBottomLeft;
			xyz6 = xyz6.Normalize();
			xyz6 = xyz6.Multiply(num);
			if (bClockwiseUp)
			{
				if (bBottom)
				{
					List<CurveInfo> list = new List<CurveInfo>();
					XYZ ptS = bottomRunData.PtRunBottomLeft - xyz4;
					XYZ ptE = bottomRunData.PtRunBottomRight - xyz4;
					list.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS, ptE, null));
					double bottomElevation = bottomRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo = new BeamCurveInfo(list, bottomElevation);
					beamCurveInfo.m_Type = BeamType.BT_Bottom;
					beamCurveInfo.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo);
				}
				if (bMid)
				{
					List<CurveInfo> list2 = new List<CurveInfo>();
					XYZ ptS2 = bottomRunData.PtRunTopLeft + xyz4;
					XYZ ptE2 = bottomRunData.PtRunTopRight + xyz4;
					list2.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS2, ptE2, null));
					ptS2 = midRunData.PtRunBottomLeft - xyz5;
					ptE2 = midRunData.PtRunBottomRight - xyz5;
					list2.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS2, ptE2, null));
					double bottomElevation2 = midRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo2 = new BeamCurveInfo(list2, bottomElevation2);
					beamCurveInfo2.m_Type = BeamType.BT_Mid;
					beamCurveInfo2.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
					List<CurveInfo> list3 = new List<CurveInfo>();
					ptS2 = midRunData.PtRunTopLeft + xyz5;
					ptE2 = midRunData.PtRunTopRight + xyz5;
					list3.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS2, ptE2, null));
					ptS2 = topRunData.PtRunBottomLeft - xyz6;
					ptE2 = topRunData.PtRunBottomRight - xyz6;
					list3.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS2, ptE2, null));
					bottomElevation2 = topRunData.BottomElevation;
					beamCurveInfo2 = new BeamCurveInfo(list3, bottomElevation2);
					beamCurveInfo2.m_Type = BeamType.BT_Mid;
					beamCurveInfo2.m_nFloorNum = 1;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo2);
				}
				if (bLand)
				{
					List<CurveInfo> list4 = new List<CurveInfo>();
					XYZ ptS3 = ptBottomLandL + xyz;
					XYZ ptE3 = ptBottomLandR + xyz;
					list4.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS3, ptE3, null));
					double bottomElevation3 = midRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo3 = new BeamCurveInfo(list4, bottomElevation3);
					beamCurveInfo3.m_Type = BeamType.BT_Land;
					beamCurveInfo3.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo3);
					List<CurveInfo> list5 = new List<CurveInfo>();
					ptS3 = ptMidLandL + xyz2;
					ptE3 = ptMidLandR + xyz2;
					list5.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS3, ptE3, null));
					bottomElevation3 = topRunData.BottomElevation;
					beamCurveInfo3 = new BeamCurveInfo(list5, bottomElevation3);
					beamCurveInfo3.m_Type = BeamType.BT_Land;
					beamCurveInfo3.m_nFloorNum = 1;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo3);
					List<CurveInfo> list6 = new List<CurveInfo>();
					ptS3 = ptToplandL + xyz3;
					ptE3 = ptTopLandR + xyz3;
					list6.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS3, ptE3, null));
					ptS3 = bottomRunData.PtRunBottomLeft - xyz4;
					ptE3 = bottomRunData.PtRunBottomRight - xyz4;
					list6.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS3, ptE3, null));
					bottomElevation3 = topRunData.BottomElevation + topRunData.RunHeight - topRunData.TreadHeight;
					beamCurveInfo3 = new BeamCurveInfo(list6, bottomElevation3);
					beamCurveInfo3.m_Type = BeamType.BT_Land;
					beamCurveInfo3.m_nFloorNum = 2;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo3);
				}
				if (bTop)
				{
					List<CurveInfo> list7 = new List<CurveInfo>();
					XYZ ptS4 = topRunData.PtRunTopLeft + xyz6;
					XYZ ptE4 = topRunData.PtRunTopRight + xyz6;
					list7.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS4, ptE4, null));
					double bottomElevation4 = topRunData.BottomElevation + topRunData.RunHeight - topRunData.TreadHeight;
					BeamCurveInfo beamCurveInfo4 = new BeamCurveInfo(list7, bottomElevation4);
					beamCurveInfo4.m_Type = BeamType.BT_Top;
					beamCurveInfo4.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo4);
					return;
				}
			}
			else
			{
				if (bBottom)
				{
					List<CurveInfo> list8 = new List<CurveInfo>();
					XYZ ptS5 = topRunData.PtRunTopLeft + xyz6;
					XYZ ptE5 = topRunData.PtRunTopRight + xyz6;
					list8.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS5, ptE5, null));
					double bottomElevation5 = topRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo5 = new BeamCurveInfo(list8, bottomElevation5);
					beamCurveInfo5.m_Type = BeamType.BT_Bottom;
					beamCurveInfo5.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo5);
				}
				if (bMid)
				{
					List<CurveInfo> list9 = new List<CurveInfo>();
					XYZ ptS6 = topRunData.PtRunBottomLeft - xyz6;
					XYZ ptE6 = topRunData.PtRunBottomRight - xyz6;
					list9.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS6, ptE6, null));
					ptS6 = midRunData.PtRunTopLeft + xyz5;
					ptE6 = midRunData.PtRunTopRight + xyz5;
					list9.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS6, ptE6, null));
					double bottomElevation6 = midRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo6 = new BeamCurveInfo(list9, bottomElevation6);
					beamCurveInfo6.m_Type = BeamType.BT_Mid;
					beamCurveInfo6.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo6);
					List<CurveInfo> list10 = new List<CurveInfo>();
					ptS6 = midRunData.PtRunBottomLeft - xyz5;
					ptE6 = midRunData.PtRunBottomRight - xyz5;
					list10.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS6, ptE6, null));
					ptS6 = bottomRunData.PtRunTopLeft + xyz4;
					ptE6 = bottomRunData.PtRunTopRight + xyz4;
					list10.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS6, ptE6, null));
					bottomElevation6 = bottomRunData.BottomElevation;
					beamCurveInfo6 = new BeamCurveInfo(list10, bottomElevation6);
					beamCurveInfo6.m_Type = BeamType.BT_Mid;
					beamCurveInfo6.m_nFloorNum = 1;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo6);
				}
				if (bLand)
				{
					List<CurveInfo> list11 = new List<CurveInfo>();
					XYZ ptS7 = ptMidLandL + xyz2;
					XYZ ptE7 = ptMidLandR + xyz2;
					list11.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS7, ptE7, null));
					double bottomElevation7 = midRunData.BottomElevation;
					BeamCurveInfo beamCurveInfo7 = new BeamCurveInfo(list11, bottomElevation7);
					beamCurveInfo7.m_Type = BeamType.BT_Land;
					beamCurveInfo7.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo7);
					List<CurveInfo> list12 = new List<CurveInfo>();
					ptS7 = ptBottomLandL + xyz;
					ptE7 = ptBottomLandR + xyz;
					list12.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS7, ptE7, null));
					bottomElevation7 = bottomRunData.BottomElevation;
					beamCurveInfo7 = new BeamCurveInfo(list12, bottomElevation7);
					beamCurveInfo7.m_Type = BeamType.BT_Land;
					beamCurveInfo7.m_nFloorNum = 1;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo7);
					List<CurveInfo> list13 = new List<CurveInfo>();
					ptS7 = ptToplandL + xyz3;
					ptE7 = ptTopLandR + xyz3;
					list13.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS7, ptE7, null));
					ptS7 = topRunData.PtRunTopLeft + xyz6;
					ptE7 = topRunData.PtRunTopRight + xyz6;
					list13.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS7, ptE7, null));
					bottomElevation7 = bottomRunData.BottomElevation + bottomRunData.RunHeight - bottomRunData.TreadHeight;
					beamCurveInfo7 = new BeamCurveInfo(list13, bottomElevation7);
					beamCurveInfo7.m_Type = BeamType.BT_Land;
					beamCurveInfo7.m_nFloorNum = 2;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo7);
				}
				if (bTop)
				{
					List<CurveInfo> list14 = new List<CurveInfo>();
					XYZ ptS8 = bottomRunData.PtRunBottomLeft - xyz4;
					XYZ ptE8 = bottomRunData.PtRunBottomRight - xyz4;
					list14.Add(this.NewLine(PenColor.PC_Gray, DashStyle.Solid, 1f, ptS8, ptE8, null));
					double bottomElevation8 = topRunData.BottomElevation + topRunData.RunHeight - topRunData.TreadHeight;
					BeamCurveInfo beamCurveInfo8 = new BeamCurveInfo(list14, bottomElevation8);
					beamCurveInfo8.m_Type = BeamType.BT_Top;
					beamCurveInfo8.m_nFloorNum = 0;
					param_stairs.m_listBeamCurve.Add(beamCurveInfo8);
				}
			}
		}

		private void DrawDoubleBranceParallelNoteInfo(ref DoubleBranchParallelStairs stairs, XYZ ptBaseLTL, XYZ ptBaseLBL, XYZ ptBaseRBL, XYZ ptBaseLBR, XYZ ptBaseRBR, XYZ ptBaseLBM, XYZ ptBaseRBM, bool bCenterStart)
		{
			double stairsWidth = stairs.getStairsWidth();
			double width = stairs.m_LandData.Width;
			double dWellWidth = stairs.m_dWellWidth;
			XYZ xyz = ptBaseLTL + XYZ.BasisX * stairsWidth;
			XYZ xyz2 = ptBaseLTL + XYZ.BasisY * width + XYZ.BasisY * 1.5;
			XYZ xyz3 = xyz + XYZ.BasisY * width + XYZ.BasisY * 1.5;
			if (LandingType.LT_Sector == stairs.m_LandData.TheType)
			{
				XYZ xyz4 = Geometry.CalculatMidPoint(xyz2, xyz3);
				XYZ xyz5 = new XYZ(0.0, stairsWidth / 2.0, 0.0);
				xyz4 += xyz5;
				xyz2 += XYZ.BasisY * (xyz4.Y - xyz2.Y);
				xyz3 += XYZ.BasisY * (xyz4.Y - xyz3.Y);
			}
			this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "梯间宽度", 0.8, 5.0, 2.0, 0, null);
			xyz2 = ptBaseLBL - XYZ.BasisY * 2.0;
			xyz3 = ptBaseRBL - XYZ.BasisY * 2.0;
			this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "边梯段宽", 0.8, 5.0, 2.0, 0, null);
			xyz2 = ptBaseLBR - XYZ.BasisY * 2.0;
			xyz3 = ptBaseRBR - XYZ.BasisY * 2.0;
			this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "边梯段宽", 0.8, 5.0, 2.0, 0, null);
			xyz2 = ptBaseLBM - XYZ.BasisY * 2.0;
			xyz3 = ptBaseRBM - XYZ.BasisY * 2.0;
			this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "中梯段宽", 0.8, 5.0, 2.0, 0, null);
			if (1E-09 < width)
			{
				XYZ xyz6 = ptBaseLTL + XYZ.BasisY * width;
				xyz2 = ptBaseLTL - XYZ.BasisX * 1.5;
				xyz3 = xyz6 - XYZ.BasisX * 1.5;
				this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "休息平台", 0.8, 2.0, 5.0, 0, null);
			}
			xyz2 = ptBaseRBR + XYZ.BasisY * stairs.m_LeftRunData.TreadDepth + XYZ.BasisX * 1.5;
			xyz3 = ptBaseRBR + XYZ.BasisX * 1.5;
			this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "踏步宽度", 0.8, 2.0, 5.0, 0, null);
			if (1E-09 <= dWellWidth)
			{
				if (1E-09 <= ptBaseLBM.Y)
				{
					xyz2 = ptBaseRBL - XYZ.BasisY * 5.0;
					xyz3 = ptBaseRBL + XYZ.BasisX * dWellWidth - XYZ.BasisY * 5.0;
				}
				else
				{
					xyz2 = ptBaseLBM - XYZ.BasisX * dWellWidth - XYZ.BasisY * 5.0;
					xyz3 = ptBaseLBM - XYZ.BasisY * 5.0;
				}
				this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "梯井宽", 0.8, 5.0, 2.0, 0, null);
				if (1E-09 <= ptBaseLBM.Y)
				{
					xyz2 = ptBaseLBR - XYZ.BasisX * dWellWidth - XYZ.BasisY * 5.0;
					xyz3 = ptBaseLBR - XYZ.BasisY * 5.0;
				}
				else
				{
					xyz2 = ptBaseRBM - XYZ.BasisY * 5.0;
					xyz3 = ptBaseRBM + XYZ.BasisX * dWellWidth - XYZ.BasisY * 5.0;
				}
				this.DrawStairsNoteInfo(ref stairs.m_listOtherCurve, ref stairs.m_listText, xyz2, xyz3, "梯井宽", 0.8, 5.0, 2.0, 0, null);
			}
		}

		protected void DrawDimensions(EdgeInfo centerCurve, string labelText, ref List<CurveInfo> curveInfoList, ref TextNoteInfo textInfo, int stairsStyle, XYZ vecTextTrans)
		{
			XYZ startPoint = centerCurve.StartPoint;
			XYZ endPoint = centerCurve.EndPoint;
			float lineWidth = 2f;
			double num = 0.4;
			double num2 = num * 1.5;
			if (centerCurve.IsArc)
			{
				XYZ xyz = null;
				Geometry.GetCenterWithBulge(startPoint, endPoint, centerCurve.Bulge, ref xyz);
				XYZ xyz2 = XYZ.BasisZ;
				if (Geometry.LessThan(centerCurve.Bulge, 0.0))
				{
					xyz2 = -XYZ.BasisZ;
				}
				XYZ xyz3 = Geometry.CalculatMidPoint(startPoint, endPoint, xyz, xyz2);
				double num3 = 0.0;
				Geometry.GetRadiusWithBulge(startPoint, endPoint, centerCurve.Bulge, ref num3);
				curveInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint, endPoint, xyz3));
				XYZ pt = (startPoint - xyz).Normalize();
				XYZ xyz4 = Geometry.RotateTo(pt, Math.PI*.5, xyz2).Normalize() * num;
				XYZ xyz5 = Geometry.RotateTo(pt, 0.78539816339744828, xyz2).Normalize() * num;
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint + xyz4, startPoint - xyz4, null));
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint + xyz5, startPoint - xyz5, null));
				XYZ pt2 = (endPoint - xyz).Normalize();
				xyz4 = Geometry.RotateTo(pt2, Math.PI*.5, xyz2).Normalize() * num;
				xyz5 = Geometry.RotateTo(pt2, 0.78539816339744828, xyz2).Normalize() * num;
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint + xyz4, endPoint - xyz4, null));
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint + xyz5, endPoint - xyz5, null));
				xyz3 = Geometry.TransformPoint(xyz3, this.m_Transform);
				textInfo = new TextNoteInfo(labelText, PenColor.PC_Black, num2, xyz3, num2 * (double)labelText.Length * 1.5, num2 * 1.5);
				return;
			}
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint, endPoint, null));
			XYZ pt3 = (endPoint - startPoint).Normalize();
			XYZ xyz6 = Geometry.RotateTo(pt3, Math.PI*.5, XYZ.BasisZ).Normalize() * num;
			XYZ xyz7 = Geometry.RotateTo(pt3, 0.78539816339744828, XYZ.BasisZ).Normalize() * num;
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint + xyz6, startPoint - xyz6, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, startPoint + xyz7, startPoint - xyz7, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint + xyz6, endPoint - xyz6, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, lineWidth, endPoint + xyz7, endPoint - xyz7, null));
			XYZ xyz8 = Geometry.CalculatMidPoint(startPoint, endPoint);
			if (stairsStyle == 0)
			{
				double num4 = num2 * 2.5;
				if ("梯间宽度" == labelText)
				{
					xyz8 += XYZ.BasisY * num4;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("休息平台" == labelText)
				{
					xyz8 -= XYZ.BasisX * num4;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("踏步宽度" == labelText)
				{
					xyz8 += XYZ.BasisX * num4;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("边梯段宽" == labelText || "中梯段宽" == labelText || "梯井宽" == labelText)
				{
					xyz8 -= XYZ.BasisY * num4;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else
				{
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
			}
			else if (1 == stairsStyle)
			{
				double num5 = num2 * 2.5;
				if ("边梯段宽" == labelText)
				{
					xyz8 -= XYZ.BasisX * num5;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("中梯段宽" == labelText)
				{
					xyz8 -= XYZ.BasisY * num5;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("休息平台长度" == labelText)
				{
					xyz8 += XYZ.BasisY * num5;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("休息平台宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num5;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("踏步宽度" == labelText)
				{
					xyz8 += XYZ.BasisY * num5;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
			}
			else if (2 == stairsStyle)
			{
				double num6 = num2 * 2.5;
				if ("边梯宽度" == labelText || "中梯段宽" == labelText)
				{
					xyz8 -= XYZ.BasisY * num6;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("边梯段长左" == labelText || "边平台宽左" == labelText || "平台长度中" == labelText)
				{
					labelText = labelText.Remove(4);
					xyz8 -= XYZ.BasisX * num6;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("边梯段长右" == labelText || "边平台宽右" == labelText)
				{
					labelText = labelText.Remove(4);
					xyz8 += XYZ.BasisX * num6;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("踏步宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num6;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("边平台长" == labelText || "二跑梯长" == labelText || "中平台宽度" == labelText)
				{
					xyz8 += XYZ.BasisY * num6;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
			}
			else if (3 == stairsStyle)
			{
				double num7 = num2 * 2.5;
				if ("平台宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num7;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("梯段宽度" == labelText)
				{
					xyz8 += XYZ.BasisY * num7;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("踏步宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num7;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("梯井宽度" == labelText)
				{
					xyz8 = xyz8 + XYZ.BasisX * num7 + XYZ.BasisY * num7;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
			}
			else if (4 == stairsStyle)
			{
				double num8 = num2 * 2.5;
				if ("梯间宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num8;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("梯间长度" == labelText)
				{
					xyz8 += XYZ.BasisY * num8;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("踏步宽度" == labelText)
				{
					xyz8 -= XYZ.BasisX * num8;
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("一跑宽度" == labelText)
				{
					if (vecTextTrans != null)
					{
						xyz8 += vecTextTrans * num8;
					}
					else
					{
						xyz8 -= XYZ.BasisY * num8;
					}
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("二跑宽度" == labelText)
				{
					if (vecTextTrans != null)
					{
						xyz8 += vecTextTrans * num8;
					}
					else
					{
						xyz8 += XYZ.BasisX * num8;
					}
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("三跑宽度" == labelText)
				{
					if (vecTextTrans != null)
					{
						xyz8 += vecTextTrans * num8;
					}
					else
					{
						xyz8 -= XYZ.BasisY * num8;
					}
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
				else if ("四跑宽度" == labelText)
				{
					if (vecTextTrans != null)
					{
						xyz8 += vecTextTrans * num8;
					}
					else
					{
						xyz8 += XYZ.BasisX * num8;
					}
					xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
				}
			}
			textInfo = new TextNoteInfo(labelText, PenColor.PC_Black, num2, xyz8, num2 * (double)labelText.Length * 1.5, num2 * 1.5);
		}

		protected void DrawDimensions(EdgeInfo centerCurve, string labelText, ref List<CurveInfo> curveInfoList, ref TextNoteInfo textInfo, XYZ vecTransDiretion, PenColor color, float LineWidth)
		{
			XYZ startPoint = centerCurve.StartPoint;
			XYZ endPoint = centerCurve.EndPoint;
			double num = 0.4;
			double num2 = num * 1.5;
			if (centerCurve.IsArc)
			{
				XYZ xyz = null;
				Geometry.GetCenterWithBulge(startPoint, endPoint, centerCurve.Bulge, ref xyz);
				XYZ xyz2 = XYZ.BasisZ;
				if (Geometry.LessThan(centerCurve.Bulge, 0.0))
				{
					xyz2 = -XYZ.BasisZ;
				}
				XYZ xyz3 = Geometry.CalculatMidPoint(startPoint, endPoint, xyz, xyz2);
				double num3 = 0.0;
				Geometry.GetRadiusWithBulge(startPoint, endPoint, centerCurve.Bulge, ref num3);
				curveInfoList.Add(this.NewArc(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint, endPoint, xyz3));
				XYZ pt = (startPoint - xyz).Normalize();
				XYZ xyz4 = Geometry.RotateTo(pt, Math.PI*.5, xyz2).Normalize() * num;
				XYZ xyz5 = Geometry.RotateTo(pt, 0.78539816339744828, xyz2).Normalize() * num;
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint + xyz4, startPoint - xyz4, null));
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint + xyz5, startPoint - xyz5, null));
				XYZ pt2 = (endPoint - xyz).Normalize();
				xyz4 = Geometry.RotateTo(pt2, Math.PI*.5, xyz2).Normalize() * num;
				xyz5 = Geometry.RotateTo(pt2, 0.78539816339744828, xyz2).Normalize() * num;
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, endPoint + xyz4, endPoint - xyz4, null));
				curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, endPoint + xyz5, endPoint - xyz5, null));
				xyz3 = Geometry.TransformPoint(xyz3, this.m_Transform);
				textInfo = new TextNoteInfo(labelText, PenColor.PC_Black, num2, xyz3, num2 * (double)labelText.Length * 1.5, num2 * 1.5);
				return;
			}
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint, endPoint, null));
			XYZ pt3 = (endPoint - startPoint).Normalize();
			XYZ xyz6 = Geometry.RotateTo(pt3, Math.PI*.5, XYZ.BasisZ).Normalize() * num;
			XYZ xyz7 = Geometry.RotateTo(pt3, 0.78539816339744828, XYZ.BasisZ).Normalize() * num;
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint + xyz6, startPoint - xyz6, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, startPoint + xyz7, startPoint - xyz7, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, endPoint + xyz6, endPoint - xyz6, null));
			curveInfoList.Add(this.NewLine(PenColor.PC_Black, DashStyle.Solid, LineWidth, endPoint + xyz7, endPoint - xyz7, null));
			XYZ xyz8 = Geometry.CalculatMidPoint(startPoint, endPoint);
			double num4 = num2 * 2.5;
			XYZ xyz9 = vecTransDiretion * num4;
			xyz8 += xyz9;
			xyz8 = Geometry.TransformPoint(xyz8, this.m_Transform);
			textInfo = new TextNoteInfo(labelText, color, num2, xyz8, num2 * (double)labelText.Length * 1.5, num2 * 1.5);
		}

		protected void DrawUpDownNoteInfo(ref List<TextNoteInfo> textNoteInfo, List<UpDownText> arUpDownText)
		{
			foreach (UpDownText upDownText in arUpDownText)
			{
				string text = upDownText.m_text;
				XYZ xyz = upDownText.m_position;
				if (!string.IsNullOrEmpty(text) && xyz != null)
				{
					xyz = Geometry.TransformPoint(xyz, this.m_Transform);
					TextNoteInfo item = new TextNoteInfo(text, PenColor.PC_Black, (double)text.Length, xyz, (double)text.Length, (double)text.Length * 1.5);
					textNoteInfo.Add(item);
				}
			}
		}

		protected void DrawUpStairsNoteInfo(ref List<TextNoteInfo> textNoteInfo, bool bCenterStart, XYZ ptLeft, XYZ ptMid, XYZ ptRight)
		{
			ptLeft = Geometry.TransformPoint(ptLeft, this.m_Transform);
			ptMid = Geometry.TransformPoint(ptMid, this.m_Transform);
			ptRight = Geometry.TransformPoint(ptRight, this.m_Transform);
			if (bCenterStart)
			{
				string text = "上";
				TextNoteInfo item = new TextNoteInfo(text, PenColor.PC_Black, (double)text.Length, ptMid, (double)text.Length, (double)text.Length * 1.5);
				textNoteInfo.Add(item);
				text = "下";
				item = new TextNoteInfo(text, PenColor.PC_Black, (double)text.Length, ptLeft, (double)text.Length, (double)text.Length * 1.5);
				textNoteInfo.Add(item);
				item = new TextNoteInfo(text, PenColor.PC_Black, (double)text.Length, ptRight, (double)text.Length, (double)text.Length * 1.5);
				textNoteInfo.Add(item);
				return;
			}
			string text2 = "上";
			TextNoteInfo item2 = new TextNoteInfo(text2, PenColor.PC_Black, (double)text2.Length, ptLeft, (double)text2.Length, (double)text2.Length * 1.5);
			textNoteInfo.Add(item2);
			item2 = new TextNoteInfo(text2, PenColor.PC_Black, (double)text2.Length, ptRight, (double)text2.Length, (double)text2.Length * 1.5);
			textNoteInfo.Add(item2);
			text2 = "下";
			item2 = new TextNoteInfo(text2, PenColor.PC_Black, (double)text2.Length, ptMid, (double)text2.Length, (double)text2.Length * 1.5);
			textNoteInfo.Add(item2);
		}

		protected void DrawStairsNoteInfo(ref List<CurveInfo> listOtherCurve, ref List<TextNoteInfo> listTextNote, XYZ ptStart, XYZ ptEnd, string sText, double dHeight, double dBoxWidth, double dBoxHeight, int nStairsType, XYZ vecTextTrans = null)
		{
			EdgeInfo centerCurve = new EdgeInfo(ptStart, ptEnd, 0.0);
			TextNoteInfo item = default(TextNoteInfo);
			this.DrawDimensions(centerCurve, sText, ref listOtherCurve, ref item, nStairsType, vecTextTrans);
			item.m_Height = dHeight;
			item.m_BoundingBoxWidth = dBoxWidth;
			item.m_BoundingBoxHeight = dBoxHeight;
			listTextNote.Add(item);
		}

		protected void DrawStairsNoteInfo(ref List<CurveInfo> listOtherCurve, ref List<TextNoteInfo> listTextNote, XYZ ptStart, XYZ ptEnd, string sText, double dHeight, double dBoxWidth, double dBoxHeight, XYZ vecTrans, PenColor color)
		{
			EdgeInfo centerCurve = new EdgeInfo(ptStart, ptEnd, 0.0);
			TextNoteInfo item = default(TextNoteInfo);
			this.DrawDimensions(centerCurve, sText, ref listOtherCurve, ref item, vecTrans, color, 2f);
			item.m_Height = dHeight;
			item.m_BoundingBoxWidth = dBoxWidth;
			item.m_BoundingBoxHeight = dBoxHeight;
			listTextNote.Add(item);
		}

		public const double _epsDouble = 1E-09;

		private Application m_App;

		protected Transform m_Transform;

		protected const PenColor m_ArrowColor = PenColor.PC_Black;

		protected const PenColor m_BoundaryColor = PenColor.PC_Black;

		protected const PenColor m_CurveColor = PenColor.PC_Gray;

		protected const PenColor m_TextColor = PenColor.PC_Black;

		protected const PenColor m_BasePointColor = PenColor.PC_Red;

		protected const PenColor m_DimensionColor = PenColor.PC_Black;

		protected const DashStyle m_Solid = DashStyle.Solid;

		protected const DashStyle m_Dash = DashStyle.Dash;

		protected const float m_LineWidth1 = 1f;

		protected const float m_LineWidth2 = 2f;
	}
}
